<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../css/icon.css">
    <link rel="stylesheet" type="text/css" href="../css/easyui.css">
    <link rel="stylesheet" type="text/css" href="../css/repex.css">
    <script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="../js/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../js/imonJYRHUtils.js"></script>
    <script type="text/javascript" language="javascript">
        var centerTabs;
        var tabsMenu;
        var numtabs;
        $(function () {
            numtabs = 0;
            tabsMenu = $('#tabsMenu').menu({
                onClick : function(item) {
                    var curTabTitle = $(this).data('tabTitle');
                    var type = $(item.target).attr('type');

                    if (type === 'close') {
                        var t = centerTabs.tabs('getTab', curTabTitle);
                        if (t.panel('options').closable) {
                            centerTabs.tabs('close', curTabTitle);
                        }
                        return;
                    }

                    var allTabs = centerTabs.tabs('tabs');
                    var closeTabsTitle = [];

                    $.each(allTabs, function() {
                        var opt = $(this).panel('options');
                        if (opt.closable && opt.title != curTabTitle && type === 'closeOther') {
                            closeTabsTitle.push(opt.title);
                        } else if (opt.closable && type === 'closeAll') {
                            closeTabsTitle.push(opt.title);
                        }
                    });

                    for ( var i = 0; i < closeTabsTitle.length; i++) {
                        centerTabs.tabs('close', closeTabsTitle[i]);
                    }
                }
            });
            centerTabs = $('#centerTabs').tabs({
                border : false,
                fit : true,
                onClose: function(title){
                    return numtabs --;
                },
                onContextMenu : function(e, title) {
                    e.preventDefault();
                    tabsMenu.menu('show', {
                        left : e.pageX,
                        top : e.pageY
                    }).data('tabTitle', title);
                }
            });
        });
        function addTabFun(opts) {
            if(numtabs<10){
                var options = $.extend({
                    content : '<iframe src="' + opts.src + '" frameborder="0" style="border:0;width:100%;height:99.2%;"></iframe>',
                    closable : true,
                    iconCls : ''
                }, opts);
                if (centerTabs.tabs('exists', options.title)) {
                    centerTabs.tabs('close', options.title);
                }
                centerTabs.tabs('add', options);
                numtabs ++;
            }else {
                $.messager.alert('提示','您已经打开很多页面了，请关掉其他画面再打开新的画面！','prompt');
            }
        };
        function exitSystem(action){
            if (confirm('您确定要退出系统吗？'))
                window.parent.location=action;
        }
        var operateDialog;
        var message= $.messager;
        function changeUserPassword_(){
            var href = "${ctx}/config/sys/user/user_editCurrentUI.do?user.tsUserInfoId=${sessionUser.tsUserInfoId}";
            operateDialog = $("#operateDialog").dialog({});
            $("#operateIFrame")[0].src=imonJYRH.url(href);
            operateDialog.dialog('open');
            imonJYRH.showZone();
        }
    </script>
</head>
<body class="easyui-layout">
<div data-options="region:'north',border:true" style="height:50px;background:#C8D4EA;">
    <div style="position:absolute;left:4px;top:0px;">
        <img height="50px" src="../css/images/logo.jpg">
    </div>
    <div style="position:absolute;right:0px;bottom:0px;display:inline;">
        <span style="height:18px;line-height:12px;"><!-- ${sessionUser.personName}-->系统管理员,欢迎您！</span>
        <a href="javascript:void(0);" class="easyui-linkbutton" plain="true" iconCls="icon-edit-password" onclick="changeUserPassword_();">修改密码</a>
        <a href="javascript:void(0);" class="easyui-linkbutton" plain="true" iconCls="icon-back" onclick="exitSystem('!loginOut.do')">登出</a>
    </div>
</div>
<div data-options="region:'west',split:true,title:'Nav/导航'" style="width:205px;">

    <!--<ul id="treeMenu" style="margin-top: 5px;"></ul>
    <script>
        var ctrlTreeMenu = $('#treeMenu').tree({
            url : 'tree_data.json',
            lines : true,
            loadFilter: function(rows){
                return imonJYRH.convertTree(rows);
            },
            onClick : function(node) {
                addTabFun(node);
            },
            onDblClickRow : function(node) {
                if (node.state == 'closed') {
                    $(this).tree('expand', node.target);
                } else {
                    $(this).tree('collapse', node.target);
                }
            }
        });
    </script>-->
    <ul class="easyui-tree" data-options="url:'tree_data.json'"></ul>

</div>
<div data-options="region:'center'">
    <div id="centerTabs"></div>
    <div id="tabsMenu" style="width:120px;display:none;">
        <div type="close">关闭</div>
        <div class="menu-sep"></div>
        <div type="closeOther">关闭其他</div>
        <div type="closeAll">关闭所有</div>
    </div>
</div>
<div data-options="region:'south'">
    <div align="center" style="height:18px">版权所有 上海爱德夏，推荐分辨率1024*768+，使用火狐浏览器可以获得更快的页面响应速度</div>
</div>
<div id="operateDialog" class="easyui-dialog" title="修改当前用户密码" style="width:600px;height:350px;"
     data-options="iconCls:'icon-save',resizable:true,modal:true,closed: true,collapsible:true,maximizable:true">
    <iframe scrolling="auto" id='operateIFrame' frameborder="0"  src="" style="width:100%;height:100%;"/>
</div>
</body>
</html>